using TerritoryGame.Domain.Entities.App;

namespace TerritoryGame.Application.Interfaces
{
    public interface IAppTokenService
    {
        /// <summary>
        /// 生成2小时AccessToken和7天RefreshToken
        /// </summary>
        (string AccessToken, string RefreshToken) GenerateTokens(User user);

        /// <summary>
        /// 通过RefreshToken刷新2小时AccessToken
        /// </summary>
        string? RefreshAccessToken(string refreshToken);

        /// <summary>
        /// 仅生成2小时AccessToken
        /// </summary>
        string GenerateAccessToken(User user);

        /// <summary>
        /// 仅生成7天RefreshToken
        /// </summary>
        string GenerateRefreshToken(User user);

        /// <summary>
        /// 检查 access token 是否即将过期
        /// </summary>
        bool IsAccessTokenExpiringSoon(string accessToken, int minutesBeforeExpiry = 30);

        /// <summary>
        /// 验证token格式是否正确
        /// </summary>
        bool IsValidTokenFormat(string token);
    }
} 